<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      padding: 0;
      margin: 0;
      box-sizing: border-box;
    }

    html,
    body {
      width: 100vw;
      height: 100vh;
    }

    #app {
      width: 100%;
      height: 100%;
      position: relative;
    }

    .tab {
      width: 50%;
      height: 30%;
      border: 1px solid red;
      position: absolute;
      top: 100px;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      flex-wrap: wrap;
    }

    ul {
      list-style: none;
      display: flex;
      width: 200px;
      height: 35px;
      justify-content: center;
      align-items: center;
    }

    ul>li {
      flex: 1;
      font: normal normal 20px/35px "微软雅黑";
      text-align: center;
      border: 1px solid black;
      cursor: pointer;
    }

    ul>li:nth-of-type(2) {
      margin: 0 20px;
    }

    .tabImg {
      display: flex;
      width: 100%;
      height: 80%;
      background-color: green;
      position: absolute;
      bottom: 0;
    }

    .tabImg>img {
      width: 100%;
    }
  </style>
</head>

<body>
  <div id="app">
    <div class="tab">
      <ul class="tabUl">
        <li v-for="(items,index) in list" :key="items.id" @click="handle(index)">{{items}}</li>
      </ul>

      <div class="tabImg">
        <img :src="`./img/${num}.jpg`">
      </div>

    </div>
  </div>
</body>
<script src="../js/vue.js"></script>
<script>
  const vm = new Vue({
    el: "#app",
    data: {
      list: ["苹果", "雪莉", "香蕉"],
      num: 1
    },
    methods: {
      handle(index) {
        this.num = index + 1;
      }
    }
  });
</script>

</html>